<template>
  <div>
    用户名：<input type="text" v-model="user.username"><br>
    密码：<input type="password" v-model="user.password"><br>
    <input type="button" value="登陆" @click="login()">{{landInfo}}
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data() {
    return {
      user:{},
      landInfo:""
    }
  }, methods: {
    login(){
      this.landInfo="";
      axios.get("/project/user/login",{params:this.user}).then(resp=>{
        console.log(resp.data);
        if (resp.data!=""){
          this.$router.push("/index");
        }else {
          this.landInfo="登陆失败";
        }
      })
    }
  }
}
</script>

<style scoped>

</style>